package com.yuanxiao.impl;

import com.yuanxiao.api.Service.MonitorService;
import org.springframework.stereotype.Component;
import org.apache.dubbo.config.annotation.Service;

import java.util.Random;
import java.util.concurrent.TimeUnit;

@Service
@Component
public class MonitorServiceImpl implements MonitorService {
    private static Random random=new Random();

    @Override
    public String methodA(String name) {
        try {
            TimeUnit.MILLISECONDS.sleep(random.nextInt(101));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "methodA";
    }

    @Override
    public String methodB(String name) {
        try {
            TimeUnit.MILLISECONDS.sleep(random.nextInt(101));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "methodB";
    }

    @Override
    public String methodC(String name) {
        try {
            TimeUnit.MILLISECONDS.sleep(random.nextInt(101));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "methodC";
    }
}
